package com.cskaoyan.javase.string._4exercise;

/**
 * 读程序题
 * @since 11:27
 * @author wuguidong@cskaoyan.onaliyun.com
 */
public class Demo {
    public static void main(String[] args) {
        String s1 = new String("hello");
        String s2 = new String("hello");
        // false
        System.out.println(s1 == s2);
        // true
        System.out.println(s1.equals(s2));

        String s3 = new String("hello");
        String s4 = "hello";
        // false
        System.out.println(s3 == s4);
        // true
        System.out.println(s3.equals(s4));

        String s5 = "hello";
        String s6 = "hello";
        // true
        System.out.println(s5 == s6);
        // true
        System.out.println(s5.equals(s6));
    }
}
